<!-- Navbar -->
<div th:fragment="navbar">
  <header role="banner" class="navbar navbar-inverse navbar-fixed-top bs-docs-nav">
  <div class="container">
    <div class="navbar-header">
      <button data-target=".bs-navbar-collapse" data-toggle="collapse" type="button" class="navbar-toggle">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#" th:text="#{info.sysname}">sys name</a>
    </div>
    <nav role="navigation" class="collapse navbar-collapse bs-navbar-collapse">
    		<!-- <ul class="nav navbar-nav">
                <li th:classappend="${page == 'home' ? 'active' : ''}"><a href="#" th:href="@{/}">Home</a></li>
                <li th:classappend="${page == 'messages' ? 'active' : ''}"><a href="#" th:href="@{/message}">Messages</a></li>
                <li th:classappend="${page == 'interaction' ? 'active' : ''}"><a href="#" th:href="@{/wechat/interaction/list}" th:text="#{menu.interaction}">Appointment</a></li>
            </ul> -->
            <ul class="nav navbar-nav">
                <li th:classappend="${page == 'index' ? 'active' : ''}">
                	<a href="#" th:href="@{/xyg/index}" th:text="#{menu.index}"></a>
                </li>
            </ul>
            <ul class="nav navbar-nav">
                <li th:classappend="${page == 'products' ? 'active' : ''}">
                	<a href="#" th:href="@{/xyg/products}" th:text="#{menu.products}"></a>
                </li>
            </ul>
            <ul class="nav navbar-nav">
                <li th:classappend="${page == 'sample' ? 'active' : ''}">
                	<a href="#" th:href="@{/xyg/sample/list/1}" th:text="#{menu.sample}"></a>
                </li>
            </ul>                   
      		
            <form id="logoutForm" th:action="@{/logout}" method="post">
	            <ul class="nav navbar-nav navbar-right">            
	            	<li><a href="#" sec:authentication="name">name</a></li>
	                <li th:if="${#authorization.expression('!isAuthenticated()')}"><a href="/signin" th:href="@{/signin}">Sign in</a></li>
	                <li th:if="${#authorization.expression('isAuthenticated()')}"><a href="#" onclick="logout()" th:text="#{info.logout}">Logout</a></li>				                
	            </ul>
            </form>
            <script>
            	function logout(){
            		$("#logoutForm").submit();
            	}
            </script>
    </nav>
  </div>
</header>
</div>
